package uhasselt.ontologyplugin;

import net.sf.saxon.s9api.XdmNode;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.DocumentBuilder;
import java.io.StringReader;
import javax.xml.transform.stream.StreamSource;

public class IdentityTransformer extends ToSkosTransformer {
	
	/**
	 * @param doc A RDF/XML string using SKOS
	 * @return The given document converted into an XML Tree
	 */
	public XdmNode transform(String doc){
		try {
			
			Processor processor = ToSkosTransformer.getProcessorInstance();
			DocumentBuilder documentBuilder = processor.newDocumentBuilder();
			return documentBuilder.build(new StreamSource(new StringReader(doc)));
		} catch (Exception e){
			return getEmptrySkosDocument();
		}
	}
	public void initialise(PropertyReader reader,String propertyPrefix){}
	
}